﻿using DynamicForm.Models.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace DynamicForm.Controllers
{
    public class ObjectController : Controller
    {
        //
        // GET: /Object/

        public ActionResult CreateTable()
        {
            MetaTable model = new MetaTable();
            model.TableField = new MetaTableField();
            model.Fields = new List<MetaTableField>();
            model.Fields.Add(new MetaTableField()
            {
                DataType = FieldDataType.Text,
                FieldLength = 100,
                Name = "FirstName",
                Options = ""
            });

            return View(model);
        }

        [HttpPost]
        public ActionResult CreateTable(MetaTable model)
        {

            //return View(model);
            return RedirectToAction("Index", "Home");
        }
    }

}
